package com.sm.imlibrary.roondao.entity;


import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

import java.io.Serializable;

/**
 * created by zhud on 2019/7/31
 */
@Entity(tableName = "t_chat_message")
public class DbChatMessage implements Serializable {
    //成功的
    public static final int STATE_OK = 0;
    //发送中
    public static final int STATE_UNDERWAY = 1;
    //发送失败
    public static final int STATE_ERROR = 2;

    //设置主键，并且定义自增增
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "id")
    public long id;
    //发送人
    @ColumnInfo(name = "from_id")
    public String from;
    //接受人
    @ColumnInfo(name = "to_id")
    public String to;
    //会话类型C2C
    @ColumnInfo(name = "chat_type")
    public String chatType;
    //消息类型 Text/Image
    @ColumnInfo(name = "message_type")
    public String messageType;
    //文本消息关联id
    @ColumnInfo(name = "message_text_id")
    public Long messageTextId;
    //图片消息关联id
    @ColumnInfo(name = "message_image_id")
    public Long messageImageId;
    //发送时间
    @ColumnInfo(name = "create_time")
    public Long createTime;
    //是否已读
    @ColumnInfo(name = "is_read")
    public Integer isRead;
    //发送状态
    @ColumnInfo(name = "state")
    public Integer state;

    public DbChatMessage() {
    }

}
